<template>
  <el-dialog title="收货地址" :visible="updatevisible" @opened="opendake" @close="close">
    <el-form :model="form">
      <el-form-item label="机器编号：" :label-width="formLabelWidth">
        {{revisevmdate.innerCode}}
        <!-- <el-input class="centerpler" v-model="form.name" autocomplete="off"></el-input> -->
      </el-form-item>
      <el-form-item label="供货时间：" :label-width="formLabelWidth">
        {{$moment(revisevmdate.updateTime).format('YYYY.MM.DD HH:mm:ss') }}
        <!-- <el-input v-model="form.name" autocomplete="off"></el-input> -->
      </el-form-item>
      <el-form-item label="设备类型：" :label-width="formLabelWidth">
        {{revisevmdate.type?.name}}
        <!-- <el-input v-model="form.name" autocomplete="off"></el-input> -->
      </el-form-item>
      <el-form-item label="设备容量：" :label-width="formLabelWidth">
        {{revisevmdate.type?.channelMaxCapacity}}
        <!-- <el-input v-model="form.name" autocomplete="off"></el-input> -->
      </el-form-item>
      <el-form-item label="设备点位：" :label-width="formLabelWidth">
        <el-select id="noner" v-model="revisevmdate" placeholder="请选择">
          <el-option
            v-for="item in currentPageRecordsdata"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="合作商：" :label-width="formLabelWidth">
        {{revisevmdate.node?.ownerName}}
        <!-- <el-input v-model="form.name" autocomplete="off"></el-input> -->
      </el-form-item>
      <el-form-item label="所属区域：" :label-width="formLabelWidth">
        {{ revisevmdate.region?.name}}
        <!-- <el-input v-model="form.name" autocomplete="off"></el-input> -->
      </el-form-item>
      <el-form-item label="设备地址：" :label-width="formLabelWidth">
        {{revisevmdate.node?.name}}
        <!-- <el-input v-model="form.name" autocomplete="off"></el-input> -->
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-foter">
      <el-button>取 消</el-button>
      <el-button type="primary">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
// import moment from 'moment'
import { getallnode } from '@/api/vm'
export default {
  name: 'EmperorKedeIndexupdate',
  props: {
    updatevisible: {
      type: Boolean,
      required: true
    }
    // revisevmdate: {
    //   type: Object,
    //   default: () => ({})
    // }
  },
  watch: {
    async updatevisible (newval) {
      console.log(newval)

      // const { currentPageRecords } = await getallnode(this.params)
      // console.log(currentPageRecords)
      // this.currentPageRecordsdata = currentPageRecords
      // console.log(this.currentPageRecordsdata)
    }
  },
  created () {
    // console.log(this.revisevmdate)
  },
  data () {
    return {
      formLabelWidth: '120px',
      revisevmdate: [],
      form: {},
      params: {
        pageIndex: 1,
        pageSize: 100000,
        name: null,
        regionId: null
      },
      // 下拉框数据
      currentPageRecordsdata: []
    }
  },

  mounted () {},

  methods: {
    async opendake () {
      const res = await getallnode(this.params)
      this.currentPageRecordsdata = res.data.currentPageRecords
      // const nulllll = []
      // this.currentPageRecordsdata = (res.data.currentPageRecords).map(item => {
      //   return nulllll.push(item.name)
      // })
      // this.currentPageRecordsdata = nulllll
      console.log(this.currentPageRecordsdata)
    },
    close () {
      console.log(123)
      // this.revisevmdate = []
      this.$emit('closeupdate')
    }
  }
}
</script>

<style lang="less" scoped>
/deep/ .el-dialog {
  width: 35%;
  .el-dialog__body {
    .el-form {
      .el-form-item {
        .el-form-item__content {
          // background-color: red;
          .el-input {
            .el-input__inner {
              border: none !important;
            }
            #noner {
              background-color: aqua;
              border: 1px solid red !important;
              width: 396px;
            }
          }
        }
      }
    }
  }
}
/deep/ .el-dialog__body {
  display: flex;
  // background-color: red;
}
</style>
